Repository navigation
docs(skill): lessons captured without a topical tag bypass the duplicate guard - #176
Merged
Merged
Conversation
…licate guard --lesson applies only the structural 'lesson' tag, which FindSimilar strips before comparing. With nothing else on the note the tag set is empty, sharedTag is never true, and the Jaccard branch is never evaluated — so nt accepts a near-copy of an existing lesson without a word. Measured on a real 193-note store: 116 notes live in lessons/ and 66 carried no topical tag at all, which is how it fragmented to ~75% empty-bodied one-liners while decisions/ (which gets a non-structural 'decision' tag) stayed clean. Verified both directions: --kind lesson alone silently creates the duplicate; adding --tag or --project makes the guard refuse it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the loop on why a real nt store fragmented into ~150 near-duplicate one-line lessons.
The mechanism
--lessonapplies only the structurallessontag.FindSimilarstrips structural tags before the shared-tag test, so a lesson carrying nothing else has an empty tag set →sharedTagis never true → the title-Jaccard branch is never evaluated → nt silently accepts a near-duplicate.Verified both directions on a copy of a real store, against the same existing note:
nt note … --kind lessonnt note … --kind lesson --tag browsernt note … --kind lesson --project browserWhy this explains the fragmentation
On a real 193-note store: 116 notes live in
lessons/, and 66 had no topical tag at all. Those are the ones that fragmented — ~75% of notes ended up with an empty body because the content went into the title, and near-identical lessons piled up unchecked. Meanwhiledecisions/stayed clean, because--kind decisionappliesdecision, which is non-structural and therefore survives the strip.Three consolidation paths all depended on that one predicate and all stayed silent: the write-time refusal, the MCP
similarlist, andnt distill.What this changes
Documentation only — both skills now state that a
--projector topical--tagis mandatory on capture, and why, so it reads as a correctness requirement rather than tidiness.Follow-up worth considering (not in this PR)
The durable fix is in code:
nt note --kind lessonwith no topical tag or project could warn, or fall back to comparing on title alone. Documentation stops a well-behaved agent; it doesn't stop the footgun. Note that #174 (foldingprojectinto the tag set) only helps notes that have a project — it does nothing for the tagless case above.Related: #174.